def isPrime(num):
    for i in range(2, int(num ** 0.5)):
        if num % i == 0:
            return False
    return True

p = 1
count = 0
while True:
    num = 2 ** p - 1
    if isPrime(num):
        print(num, end=" ")
        count += 1
        if count % 10 == 0:
            print()
    p += 1
    if p > 31:
        break
